<?php
class classURL{
	private $url_menu;
	private $url_product;
	private $url_file;

	function __construct(){
		$this->url_menu	 	= $_REQUEST[_URL_VARIABLE_MENU_];
		$this->url_product 	= $_REQUEST[_URL_VARIABLE_PRODUCT_];
		$this->url_file	 	= $_REQUEST[_URL_VARIABLE_FILE_];
		
		//print '   request>'.$this->url_menu.$this->url_product.$this->url_file;
	}
	
	public function SetURL($url_menu, $url_product, $url_file){
	
		if($url_menu=='') $new_url_menu	=_URL_VARIABLE_MENU_.'='._DEFAULT_URL_MENU_;
		else{
			if($url_menu!='keep_value')
				$new_url_menu		=_URL_VARIABLE_MENU_.'='.$url_menu;
			else
				$new_url_menu		=_URL_VARIABLE_MENU_.'='.$this->url_menu; 
		}
		
		if($url_product=='') $new_url_product = _URL_VARIABLE_PRODUCT_.'='._DEFAULT_URL_PRODUCT_;
		else{
			if($url_product!='keep_value')
				$new_url_product 	=_URL_VARIABLE_PRODUCT_.'='.$url_product;
			else
				$new_url_product	=_URL_VARIABLE_PRODUCT_.'='.$this->url_product; 
		}
		
		if($url_file=='') $new_url_file =_URL_VARIABLE_FILE_.'='._DEFAULT_URL_FILE_;
		else{
			if($url_file!='keep_value')
				$new_url_file 		=_URL_VARIABLE_FILE_.'='.$url_file;
			else
				$new_url_file		=_URL_VARIABLE_FILE_.'='.$this->url_file; 
		}
			
		return '?'.$new_url_menu.'&amp;'.$new_url_product.'&amp;'.$new_url_file;
	}
	
	public function GetMenu(){
		return $this->url_menu;
	}
	
	public function GetProduct(){
		return $this->url_product;
	}
	
	public function GetFile(){
		return $this->url_file;
	}
}
?>